package org.lvgo.filter;

import java.util.List;

/**
 * 并且过滤器,同时满足
 *
 * @author lvgo
 * @version 1.0
 * @date 2018/9/21 0021 17:08
 */
public class AndFilter implements Criteria {

    private Criteria c1;
    private Criteria c2;

    public AndFilter(Criteria c1, Criteria c2) {
        this.c1 = c1;
        this.c2 = c2;
    }

    @Override
    public List<Person> filterPerson(List<Person> people) {
        List<Person> people1 = c1.filterPerson(people);
        return c2.filterPerson(people1);
    }
}
